package com.project.util;

import org.apache.shiro.authz.AuthorizationException;
import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 处理未授权的异常
 */
@RestControllerAdvice
public class PressException {
    @ExceptionHandler({AuthorizationException.class, UnauthorizedException.class})
    public String noPermission(){
        System.err.println(" =--------------------------------------------- ");
        return "noPermission";
    }
}
